import Opt from '@/components/dt/info/Opt.js'

class RoomOpt extends Opt {

  constructor(info, type) {
    super(info)
    this.type = type
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [{
        title: '房源名称',
        key: 'roomName',
        text: {}
      },
      {
        title: '客户姓名',
        key: 'customerName',
        text: {}
      },
      {
        title: '签约人',
        key: 'contractorName',
        text: {}
      },
      {
        title: '交房人',
        key: 'handoverName',
        text: {}
      },
      {
        title: '认购日期',
        key: 'subscriptionDate',
        text: {
          type: 'date'
        }
      },
      {
        title: '签约日期',
        key: 'contractDate',
        text: {
          type: 'date'
        }
      },
      {
        title: '全款到账日期',
        key: 'predictAccountDate',
        text: {
          type: 'date'
        }
      },
      {
        title: '交房日期',
        key: 'dealRoomDate',
        text: {
          type: 'date'
        }
      },
      {
        title: '签约总价',
        key: 'totalPrice',
        text: {
          type: 'number',
          unit: '元'
        }
      },
      {
        title: '本次结算总销',
        key: 'settlementAmount',
        visible: this.type == 'STANDARD',
        text: {
          type: 'number',
          unit: '元'
        }
      },
      {
        title: '本次结算代理费',
        key: 'agentCost',
        visible: this.type != 'PRE' && this.type != 'HANDOVER',
        text: {
          type: 'number',
          unit: '元'
        }
      },
      {
        title: '是否渠道',
        key: 'channelSourceName',
        text: {}
      },
      {
        title: '是否关系户',
        key: 'isAssociates',
        text: {}
      },
      {
        title: '匹配奖金模板',
        key: 'templateName',
        visible: this.type != 'HANDOVER',
        text: {}
      },
      {
        title: '奖金结算条件',
        key: 'settlementCondition',
        visible: this.type == 'PRE',
        text: {}
      }
    ]
  }
}

export default RoomOpt
